<!DOCTYPE html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>修改商品信息</title>
    <meta name="description" content="后台管理">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/png" href="assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <link rel="stylesheet" href="__CSS__/amazeui.min.css"/>
    <link rel="stylesheet" href="__CSS__/admin.css">
    <script src="__JS__/jquery.min.js"></script>
    <script src="__JS__/app.js"></script>
</head>

<body>
{include file="common/header" /}
<div class="am-cf admin-main">
    {include file="common/menu" /}
    <div class=" admin-content">

        <div class="daohang">

        </div>


        <div class="admin-biaogelist">

            <div class="listbiaoti am-cf">
                <ul class="am-icon-flag on"> 栏目名称</ul>

                <dl class="am-icon-home" style="float: right;"> 当前位置： <a href="#">修改商品</a></dl>


            </div>

            <div class="fbneirong">
                <form class="am-form" method="post" action="{:url('goods_edit','id='.$goods_id.'')}" enctype="multipart/form-data">
                    <input type="hidden" value="{$page}" name="p">
                    <div class="am-form-group am-cf">
                        <div class="zuo">产品型号：</div>
                        <div class="you">
                            <input type="text" class="am-input-sm" value="{$item['model']}" name="model" placeholder="请输入产品型号">
                        </div>
                    </div>
                    <!--<div class="am-form-group am-cf">-->
                    <!--<div class="zuo">描述：</div>-->
                    <!--<div class="you">-->
                    <!--<textarea class="" rows="2" id="doc-ta-1"></textarea>-->
                    <!--</div>-->
                    <!--</div>-->
                    <!--<div class="am-form-group am-cf">-->
                    <!--<div class="zuo">缩略图：</div>-->
                    <!--<div class="you"><input type="file" id="doc-ipt-file-1"> </div>-->
                    <!--</div>-->

                    <div class="am-form-group am-cf">
                        <div class="zuo">产品图片：</div>
                        <div class="you" id="images-box">
                            {volist name="images" id="vo"}
                                <p style="position:relative; padding: 10px; margin:10px 0;background: #f5f5f5;">
                                    <img src="__UPLOADS__/{$vo.img}" width="auto" height="100"/>
                                    <input type="hidden" value="{$vo.id}" name="iid[]"/>
                                    <input type="file" name="replace_{$vo.id}" style="margin: 5px 0; display: none;">
                                    <button type="button" class="replace" style="position:absolute; right: 50px;top:0;">替换</button>
                                    <button type="button" class="del" style="position:absolute; right: 0;top:0;">删除</button>
                                </p>
                            {/volist}
                        </div>
                    </div>

                    <div class="am-form-group am-cf">
                        <div class="zuo"></div>
                        <div class="you">
                            <button type="button" id="add-images">添加图片</button>
                        </div>
                    </div>


                    <script>
                        $('#add-images').click(function () {
                            var $files = $('#images-box'),
                                html = '';

                            html +='<p style="position:relative;">';
                            html += '<input type="file" name="images[]" style="margin: 5px 0;">';
                            html += '<button type="button" class="del" style="position:absolute; right: 0;top:0;">删除</button>';
                            html += '</p>';

                            $files.append(html);

                        });

                        $(document).on('click', '#images-box .del',function(){
                            $(this).parent().remove();
                        }).on('click', '#images-box .replace', function(){
                            $('img', $(this).parent()).toggle();
                            $('[type=file]', $(this).parent()).toggle();

                            if($(this).text() == '替换'){
                                $(this).text('取消替换');
                            }else{
                                $(this).text('替换');
                            }
                        });
                    </script>
                    <div class="am-form-group am-cf">
                        <div class="you" style="margin-left: 11%;">
                            <button type="submit" class="am-btn am-btn-success am-radius">发布商品</button>
                        </div>
                    </div>
                </form>
            </div>
            {include file="common/footer" /}
        </div>
    </div>

</body>
</html>